package swu.cx.flowgroup

import android.animation.ValueAnimator
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {
    private val downLoadAnimator:ValueAnimator by lazy {
        ValueAnimator.ofFloat(0f,1.0f).apply {
            duration = 2000
            addUpdateListener {
                progressCircle.progress = it.animatedValue as Float
            }
        }
    }
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        Log.v("cx","onCreate")
        startBtn.setOnClickListener {
            downLoadAnimator.start()
        }
    }

    override fun onResume() {
        super.onResume()
        Log.v("cx","onResume")
    }
}